#ifndef LEVELOBJECTSELECTIONMANAGER_H
#define LEVELOBJECTSELECTIONMANAGER_H

#include "appGlobals.h"

namespace LevelObjects {

class AbstractLevelObject;
class Level;

class LevelObjectSelectionManager : public QObject
{
	Q_OBJECT

public:
	typedef QList<QPointer<AbstractLevelObject> > Selection;
	LevelObjectSelectionManager(QObject *parent);

	void select(QPointer<AbstractLevelObject> lo);
	void select(QList<QPointer<AbstractLevelObject> > loList);
	void deselect(QPointer<AbstractLevelObject> lo);

	void selectAll();
	void deselectAll();

	bool isSelected(QPointer<AbstractLevelObject> lo);

	const Selection& selection() const;
private:
	Level& level();
	Selection m_selection;
signals:
	void objectSelectionChanged();
	void levelObjectSelected(QPointer<AbstractLevelObject> lo);
	void levelObjectDeselected(QPointer<AbstractLevelObject> lo);
};

} // namespace LevelObjects

#endif // LEVELOBJECTSELECTIONMANAGER_H
